package com.hanxiaozhang.base.quartz;

import com.hanxiaozhang.util.JsonUtil;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.time.LocalDateTime;

/**
 * 功能描述: <br>
 * 〈测试定时任务〉
 *
 * @Author:hanxinghua
 * @Date: 2021/4/29
 */
@Slf4j
//不并发执行
// @DisallowConcurrentExecution
public class TestJob implements Job {


    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        JobDataMap jobDataMap = context.getMergedJobDataMap();
        log.info("定时任务开始执行,参数:[{}],执行时间:[{}]", JsonUtil.beanToJson(jobDataMap), LocalDateTime.now());
    }

}
